#include "Appender.h"

namespace logging {

Appender::Appender(const char *name) {
	int len = strlen(name);
	_name = new char[len+1];
	strncpy(_name, name, len+1);
}

Appender::~Appender() {
	delete[] _name;
}

char* Appender::levelToString(Level level) {
	switch(level) {
	case log_debug:
		return "DEBUG";
	case log_info:
		return "INFO";
	case log_warn:
		return "WARN";
	case log_error:
		return "ERROR";
	case log_fatal:
		return "FATAL";
	default:
		return "UNKNOWN";
	}
}

}
